/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.meducated.sim.model;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

/**
 *
 * @author Carina
 */
public class SumIntegrator implements PropertyIntegrator<Double> {

    

    @Override
    public Double integrate(Property<Double> property, double t, double dt, Double value) {
        double dtSum = 0;
        Iterator <Entry<Effector<Double>,Double>> i= property.getConnector().getFactorIterator();
        while(i.hasNext()) {
          dtSum += i.next().getValue();
        }
        return new Double(value + dtSum);
    }
}
